using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class web_pages_nguoitimviec_hosodatao : System.Web.UI.UserControl
{
    public string act = "";
    public string id = "";
    public string name = "";
    public string sSQLSelect = "";
    Common comm = new Common();
    public DataTable dtt;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (!(Session["NTV_id"] == null))
            {
                if (!string.IsNullOrEmpty(Request.Params["idluu"]))
                {
                    id = Request.Params["idluu"];
                    if (!string.IsNullOrEmpty(Request.Params["act"])) act = Request.Params["act"];
                    if (act == "delluu")
                    {
                        sSQLSelect = "delete from HeThong_luu_doi_tuong where kieu_luu=0 and ma_doi_tuong=" + id + " and" +
                            " ma_nguoi_luu='" + Session["NTV_id"].ToString() + "'";
                        //Response.Write(sSQLSelect);
                        int i = comm.execNoneQuery(sSQLSelect);
                        Response.Redirect("nguoitimviec_quanly.aspx?page=tuyendungluu");
                    }
                }
                sSQLSelect = "SELECT HeThong_luu_doi_tuong.ma_nguoi_luu, HeThong_luu_doi_tuong.id, HeThong_luu_doi_tuong.ma_doi_tuong, HeThong_luu_doi_tuong.kieu_luu, " +
                        " HeThong_luu_doi_tuong.ngay_dua, HeThong_luu_doi_tuong.mo_ta, ViecLamTrong_ho_so_tuyen_dung.ma_ho_so, DoanhNghiep_doanh_nghiep.ten_doanh_nghiep, " +
                        " ViecLamTrong_ho_so_tuyen_dung.tieu_de_ho_so, ViecLamTrong_ho_so_tuyen_dung.so_luong_tuyen, DanhMuc_chuc_danh.ten_chuc_danh" +
                        " FROM DoanhNghiep_doanh_nghiep INNER JOIN" +
                        " ViecLamTrong_ho_so_tuyen_dung ON DoanhNghiep_doanh_nghiep.ma_doanh_nghiep = ViecLamTrong_ho_so_tuyen_dung.ma_doanh_nghiep INNER JOIN" +
                        " DanhMuc_chuc_danh ON ViecLamTrong_ho_so_tuyen_dung.ma_chuc_danh = DanhMuc_chuc_danh.ma_chuc_danh CROSS JOIN" +
                        " HeThong_luu_doi_tuong" +
                        " WHERE ma_ho_so=ma_doi_tuong AND kieu_luu=0 and ma_nguoi_luu='"+Session["NTV_id"].ToString() + "'";
                dtt = comm.getDataTable(sSQLSelect);
                rpt_list_obj.DataSource = dtt;
                rpt_list_obj.DataBind();
            }
        }
    }
    protected void rpt_list_obj_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
    }
}
